import request from "@/utils/request";
export default {
  //商品分类
  goodsCategory(params) {
    return request({
      baseURL: window.APP_GETEWAY.goods,
      url: "/base/backend-classification/get-list",
      method: "get",
      params
    });
  },
  //仓库权限列表
  warehouseList(data) {
    return request({
      url: "/warehouse",
      method: "get",
      params: data,
    });
  },
  //字段属性列表
  fieldAttrList(data) {
    return request({
      url: "/field-attr",
      method: "get",
      params: data,
    });
  },
  //字段属性状态
  fieldAttrStatus(data) {
    return request({
      url: "/field-attr/status",
      method: "POST",
      data,
    });
  },
  //字段属性详情
  fieldAttrdetail(data) {
    return request({
      url: "/field-attr/detail",
      method: "get",
      params: data,
    });
  },
  //字段属性日志
  fieldAttrOplog(data) {
    return request({
      url: "/field-attr/oplog",
      method: "get",
      params: data,
    });
  },
  //字段属性 - 批量分配角色
  fieldBatchRccessRole(data) {
    return request({
      url: "/field-attr/batch-access-role",
      method: "post",
      data,
    });
  },
  //字段属性-批量分配用户
  fieldBatchRccessUser(data) {
    return request({
      url: "/field-attr/batch-access-user",
      method: "post",
      data,
    });
  },
  //字段属性-分配用户-获取数据
  getfieldAttrAccesUser(data) {
    return request({
      url: "/field-attr/access-user",
      method: "get",
      params: data,
    });
  },
  //字段属性-分配用户-保存数据
  setfieldAttrAccesUser(data) {
    return request({
      url: "/field-attr/access-user",
      method: "post",
      data,
    });
  },
  //字段属性-分配角色-获取数据
  getfieldAttrAccessRole(data) {
    return request({
      url: "/field-attr/access-role",
      method: "get",
      params: data,
    });
  },
  //字段属性-分配角色-保存数据
  setfieldAttrAccessRole(data) {
    return request({
      url: "/field-attr/access-role",
      method: "post",
      data,
    });
  },
  //添加字段属性
  fieldAttrCreate(data) {
    return request({
      url: "/field-attr/create",
      method: "post",
      data,
    });
  },
  //修改字段属性-保存数据
  fieldAttrUpdate(data) {
    return request({
      url: "/field-attr/update",
      method: "post",
      data,
    });
  },

  //商品分类-分配用户-获取数据
  getAccessUser(data) {
    return request({
      url: "/goods-category/access-user",
      method: "get",
      params: data,
    });
  },
  //商品分类-分配用户-保存数据
  setAccessUser(data) {
    return request({
      url: "/goods-category/access-user",
      method: "post",
      data,
    });
  },
  //商品分类-分配角色-获取数据
  accessRole(data) {
    return request({
      url: "/goods-category/access-role",
      method: "get",
      params: data,
    });
  },
  //商品分类-分配角色-保存数据
  setAccessRole(data) {
    return request({
      url: "/goods-category/access-role",
      method: "post",
      data,
    });
  },
  //商品分类-批量分配角色
  setgoodsBatchAccessRole(data) {
    return request({
      url: "/goods-category/batch-access-role",
      method: "post",
      data,
    });
  },
  //商品分类-批量分配用户
  setgoodsBatchAccessUser(data) {
    return request({
      url: "/goods-category/batch-access-user",
      method: "post",
      data,
    });
  },
  //获取登录菜单
  getMenusList() {
    return request({
      url: "/menu",
      method: "get",
      headers: {
        "Content-Type": "application/json; charset=UTF-8",
      },
      params: { type: 1, pageNum: 1, pageSize: 200000 },
    });
  },

  //仓库权限-分配角色-获取数据
  getWarehouseAccessRole(data) {
    return request({
      url: "/warehouse/access-role",
      method: "get",
      params: data,
    });
  },
  //仓库权限-分配角色-保存数据
  setWarehouseAccessRole(data) {
    return request({
      url: "/warehouse/access-role",
      method: "post",
      data,
    });
  },
  //仓库权限-分配用户-获取数据
  getWarehouseAccessUser(data) {
    return request({
      url: "/warehouse/access-user",
      method: "get",
      params: data,
    });
  },
  //仓库权限-分配用户-保存数据
  setWarehouseAccessUser(data) {
    return request({
      url: "/warehouse/access-user",
      method: "post",
      data,
    });
  },
  //仓库权限-批量分配角色
  setWarehouseBatchAccessRole(data) {
    return request({
      url: "/warehouse/batch-access-role",
      method: "post",
      data,
    });
  },
  //仓库权限-批量分配用户
  setWarehouseBatchAccessUser(data) {
    return request({
      url: "/warehouse/batch-access-user",
      method: "post",
      data,
    });
  },
};
